package com.sunday.android.fangdaifu.bukong.activity;

import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.sunday.android.fangdaifu.bukong.R;
import com.sunday.common.utils.CacheUtils;
import com.sunday.member.base.BaseActivity;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class SettingActivity extends BaseActivity {

    @Bind(R.id.title_view)
    TextView titleView;
    @Bind(R.id.tvCahe)
    TextView tvCahe;
    @Bind(R.id.lClear)
    LinearLayout lClear;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_setting);
        ButterKnife.bind(this);
        initView();
    }

    private void initView() {
        titleView.setText("设置");
        tvCahe.setText(CacheUtils.getTotalCacheSize(mContext));
    }

    @OnClick(R.id.lClear)
    public void onViewClicked() {
        CacheUtils.clearAllCache(mContext);
        tvCahe.setText(CacheUtils.getTotalCacheSize(mContext));
    }
}
